package me.fung.keen.common

abstract class ObjectBuilder<O> {
    abstract fun registry(name: String, builder: (List<Any>) -> O)
    abstract fun obtainOrNull(name: String, params: List<Any>): O?
    open fun obtain(name: String, params: List<Any>): O {
        return obtainOrNull(name, params) ?: throw NullPointerException("No builder named '$name' ")
    }
}

